package bsts.util;

import java.util.ArrayList;
import java.util.HashMap;

import bsts.model.CableTV;
import bsts.model.DigitalVoice;
import bsts.model.Feature;
import bsts.model.MobileVoice;
import bsts.model.Plan;
import bsts.model.RateType;
import bsts.model.User;

public class InsertPlan {

	private RateType rateType;
	private ArrayList<Plan> plans;

	public InsertPlan() {
		plans = new ArrayList<Plan>();
	}

	public ArrayList<Plan> generatePlan() {

		DigitalVoice planDigital = new DigitalVoice(0, "Digital Voice",
				"Digital voice plan");
		Feature featureDigital = new Feature(0, "Subscription",
				"Monthly subscription", 10, RateType.PerMonth, true);
		Feature featureDigital1 = new Feature(1, "Call Transfer Subscription",
				"Monthly call transfer subscription", 5, RateType.PerMonth,
				false);
		Feature featureDigital2 = new Feature(2, "Local Calls", "Local calls",
				0.01, RateType.PerSecond, true);
		Feature featureDigital3 = new Feature(3, "IDD", "International calls",
				0.02, RateType.PerSecond, false);

		planDigital.addFeature(featureDigital);
		planDigital.addFeature(featureDigital1);
		planDigital.addFeature(featureDigital2);
		planDigital.addFeature(featureDigital3);

		MobileVoice planMobileVoice = new MobileVoice(1, "Mobile Voice",
				"Mobile voice plan");
		Feature featureMobileVoice = new Feature(4, "Subscription",
				"Monthly subscription", 100, RateType.PerMonth, true);
		Feature featureMobileVoice1 = new Feature(5, "Data Service",
				"Monthly data service", 30.20, RateType.PerMonth, false);
		Feature featureMobileVoice2 = new Feature(6, "Local Calls",
				"Local calls", 0.015, RateType.PerSecond, true);
		Feature featureMobileVoice3 = new Feature(7, "IDD",
				"International calls", 0.025, RateType.PerSecond, false);
		Feature featureMobileVoice4 = new Feature(8, "Roaming Calls",
				"Roaming calls", 0.5, RateType.PerSecond, false);

		planMobileVoice.addFeature(featureMobileVoice);
		planMobileVoice.addFeature(featureMobileVoice1);
		planMobileVoice.addFeature(featureMobileVoice2);
		planMobileVoice.addFeature(featureMobileVoice3);
		planMobileVoice.addFeature(featureMobileVoice4);

		CableTV planCable = new CableTV(2, "Cable TV", "Cable TV plan");
		Feature featureCable = new Feature(9, "Subscription",
				"Monthly subsciption for 3 standard channels", 50.50,
				RateType.PerMonth, true);
		Feature featureCable1 = new Feature(10, "Discovery",
				"Discovery channel", 5, RateType.PerChannel, false);
		Feature featureCable2 = new Feature(11, "National Geography",
				"National Geography channel", 5, RateType.PerChannel, false);
		Feature featureCable3 = new Feature(12, "Star Sport",
				"Star Sport channel", 5, RateType.PerChannel, false);
		Feature featureCable4 = new Feature(13, "Super Sport",
				"Super Sport channel", 5, RateType.PerChannel, false);
		Feature featureCable5 = new Feature(14, "Football Channel",
				"Football channel", 5, RateType.PerChannel, false);
		Feature featureCable6 = new Feature(15, "MTV Channel",
				"MTV channel", 5, RateType.PerChannel, false);
		Feature featureCable7 = new Feature(16, "BBC",
				"BBC channel", 5, RateType.PerChannel, false);
		Feature featureCable8 = new Feature(17, "Movies Channel",
				"Movies channel", 5, RateType.PerChannel, false);
		Feature featureCable9 = new Feature(18, "HK Drama",
				"HK Drama channel", 5, RateType.PerChannel, false);
		Feature featureCable10 = new Feature(19, "CCTV",
				"CCTV channel", 5, RateType.PerChannel, false);
		
		planCable.addFeature(featureCable);
		planCable.addFeature(featureCable1);
		planCable.addFeature(featureCable2);
		planCable.addFeature(featureCable3);
		planCable.addFeature(featureCable4);
		planCable.addFeature(featureCable5);
		planCable.addFeature(featureCable6);
		planCable.addFeature(featureCable7);
		planCable.addFeature(featureCable8);
		planCable.addFeature(featureCable9);
		planCable.addFeature(featureCable10);

		plans.add(planDigital);
		plans.add(planMobileVoice);
		plans.add(planCable);

		return plans;

	}

}
